home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MATHS
/
RLAB
/
RLAB125.ZIP
/
!RLaB
/
examples
/
pwd
< prev
next >
Wrap
Text File
|
1994-09-20
|
687b
|
50 lines
//
// Randomly generate passwordds
// Ian Searle (11/6/91)
//
static (alpha)
alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", ...
"j", "k", "l", "m", "n", "o", "p", "q", "r", ...
"s", "t", "u", "v", "w", "x", "y", "z" ];
//
// Global set-up
//
srand( "clock" );
//
// Return an integer random number between 1 and 26
//
irand = function()
{
return int( rand() );
}
//
// Generate a password
//
pwd = function()
{
tmp = "";
rand("uniform", 1, 26);
for(i in 1:6)
{
PWD[i] = alpha[ irand() ];
}
rand("uniform", 0, 9);
sprintf(tmp, "%i", irand());
PWD[7] = tmp;
sprintf(tmp, "%i", irand());
PWD[8] = tmp;
return PWD;
}